home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / PowerPC / Dev / PPCRelease / Examples / Library / LibsModule.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-10  |  1.3 KB  |  88 lines

  1. #include <exec/types.h>
  2. /* This file MUST be the gcc ppc stdarg.h file so
  3.  * i put the /ade/amigaos-ppc/include/ path as the first
  4.  * to search for in the makefile
  5.  */
  6. #include <stdarg.h>
  7. #include <powerup/gcclib/powerup_protos.h>
  8.  
  9. /* Optional Symbol filter for the library
  10.  */
  11.  
  12. char*    __LIB_LibTable[]=
  13. {
  14.     "Add",
  15.     "Sub",
  16.     "Print",
  17.     NULL
  18. };
  19.  
  20. /* Optional Version
  21.  */
  22. ULONG    __LIB_Version=42;
  23. ULONG    __LIB_Revision=666;
  24.  
  25. /* Optional Init for the library
  26.  */
  27. void*    __LIB_Init(void        *LibObject)
  28. {
  29.   return(LibObject);
  30. }
  31.  
  32. /* Optional Expunge for the library
  33.  * If you return NULL the object isn`t
  34.  * removed.
  35.  */
  36. void*    __LIB_Expunge(void    *LibObject)
  37. {
  38.   return(LibObject);
  39. }
  40.  
  41. /* Optional Open for the library
  42.  * If you return NULL the object isn`t
  43.  * opened.
  44.  */
  45. void*    __LIB_Open(void        *LibObject)
  46. {
  47.   return(LibObject);
  48. }
  49.  
  50.  
  51. /* Optional Close for the library
  52.  * If you return NULL the object isn`t
  53.  * closed.
  54.  */
  55. void*    __LIB_Close(void    *LibObject)
  56. {
  57.   return(LibObject);
  58. }
  59.  
  60. ULONG    Add(ULONG    a,
  61.             ULONG    b)
  62. {
  63.   return(a + b);
  64. }
  65.  
  66. ULONG    Sub(ULONG    a,
  67.             ULONG    b)
  68. {
  69.   return(a - b);
  70. }
  71.  
  72.  
  73.  
  74. int    Print(const char        *FmtString,
  75.               ...)
  76. {
  77. va_list args;
  78. int    Result;
  79.  
  80.   va_start(args,FmtString);
  81.  
  82.   Result    =    PPCvprintf(FmtString,
  83.                                    args);
  84.  
  85.   va_end(args);
  86.   return(Result);
  87. }
  88.